
//-----------------------------------------------------------------------
//押下すると現在時間を表示
function nowTime(obj){

 	var timeObj = document.getElementById(obj);

	var now = new Date();

	var hour = now.getHours(); // 時
	var min = now.getMinutes(); // 分
	var sec = now.getSeconds(); // 秒


	if(hour < 10) { hour = "0" + hour; }
	if(min < 10) { min = "0" + min; }
	if(sec < 10) { sec = "0" + sec; }


    document.getElementById(obj).value = hour + ':' + min;

}


//ラインコードが選択されているかどうかをチェック
function lineChk(obj){

	var obj;

	var lineCd = document.getElementById("drpLineNm");


	if(lineCd.value == ""){

		   //OP情報のHTML作成
		var html = "";
	    var htmlBtn = "";

		html += "<table width='100%'>\n";

		html += "<tr>\n";
		html += "	<td style='font-size:20px; color:blue;'>\n";

		if(obj == "drpEquipmentCd"){
			html += "			<br>「ライン名」を選択後、「設備機番」を<br>　選択して下さい。";
		}else if(obj == "drpProcessNo"){
			html += "			<br>「ライン名」を選択後、「工程NO」を<br>　選択して下さい。";
		}

		html += "	</td>\n";
		html += "</tr>\n";

		html += "</table>\n";

		htmlBtn ="";

		htmlBtn += "<table'>\n";
		htmlBtn += "<tr>\n";
		htmlBtn += "	<td  >　　　　　　";
		htmlBtn += "		<input type='button' id='opBtn' class='opBtn' onclick = 'back();'  value='確 認'>";
		htmlBtn += "	</td>";

		htmlBtn += "</tr>\n";
		htmlBtn += "</table>\n";


		document.getElementById("opBoard").innerHTML = html;
		document.getElementById("opBoardBtn").innerHTML = htmlBtn;

		document.getElementById("opBoard").style.display = "inline";
		document.getElementById("opBoardButtom").style.display = "inline";
		document.getElementById("opBoardBtn").style.display = "inline";
		document.getElementById("opBoardTop").style.display = "inline";

		//パップアップ以外は非活性
		document.getElementById("allbackgr").style.display = "inline";

	}
}



//作業内容がが選択されているかどうかをチェック
function lineChk2(obj){

	var workNm1 = document.getElementById("drpWorkNm1");
	var workNm2 = document.getElementById("drpWorkNm2");

	if(workNm1.value == ""){

		   //OP情報のHTML作成
		var html = "";
	    var htmlBtn = "";

		html += "<table width='100%'>\n";

		html += "<tr>\n";
		html += "	<td style='font-size:20px; color:blue;'>\n";
		html += "			<br>「作業内容①」を選択後、「作業内容②」　を選択して下さい。";
		html += "	</td>\n";
		html += "</tr>\n";

		html += "</table>\n";

		htmlBtn ="";

		htmlBtn += "<table'>\n";
		htmlBtn += "<tr>\n";
		htmlBtn += "	<td  >　　　　　　";
		htmlBtn += "		<input type='button' id='opBtn' class='opBtn' onclick = 'back();'  value='確 認'>";
		htmlBtn += "	</td>";

		htmlBtn += "</tr>\n";
		htmlBtn += "</table>\n";


		document.getElementById("opBoard").innerHTML = html;
		document.getElementById("opBoardBtn").innerHTML = htmlBtn;

		document.getElementById("opBoard").style.display = "inline";
		document.getElementById("opBoardButtom").style.display = "inline";
		document.getElementById("opBoardBtn").style.display = "inline";
		document.getElementById("opBoardTop").style.display = "inline";

		//パップアップ以外は非活性
		document.getElementById("allbackgr").style.display = "inline";

	}else if(workNm2.options[0].value == "null"){

		//OP情報のHTML作成
		var html = "";
	    var htmlBtn = "";

		html += "<table width='100%'>\n";

		html += "<tr>\n";
		html += "	<td style='font-size:20px; color:blue;'>\n";
		html += "			<br> 　選択できる項目がありません。";
		html += "	</td>\n";
		html += "</tr>\n";

		html += "</table>\n";

		htmlBtn ="";

		htmlBtn += "<table'>\n";
		htmlBtn += "<tr>\n";
		htmlBtn += "	<td  >　　　　　　";
		htmlBtn += "		<input type='button' id='opBtn' class='opBtn' onclick = 'back();'  value='確 認'>";
		htmlBtn += "	</td>";

		htmlBtn += "</tr>\n";
		htmlBtn += "</table>\n";


		document.getElementById("opBoard").innerHTML = html;
		document.getElementById("opBoardBtn").innerHTML = htmlBtn;

		document.getElementById("opBoard").style.display = "inline";
		document.getElementById("opBoardButtom").style.display = "inline";
		document.getElementById("opBoardBtn").style.display = "inline";
		document.getElementById("opBoardTop").style.display = "inline";

		//パップアップ以外は非活性
		document.getElementById("allbackgr").style.display = "inline";

	}
}

//入力チェック
function inputChk(obj){


	    //OP情報のHTML作成
		var html = "";
	    var htmlBtn = "";

		html += "<table width='100%'>\n";

		html += "<tr>\n";
		html += "	<td style='font-size:20px; color:blue;'>\n";
		html += "			<br>　Please select "+obj+"";
		html += "	</td>\n";
		html += "</tr>\n";

		html += "</table>\n";

		htmlBtn ="";

		htmlBtn += "<table'>\n";
		htmlBtn += "<tr>\n";
		htmlBtn += "	<td  >　　　　　　";
		htmlBtn += "		<input type='button' id='opBtn' class='opBtn' onclick = 'back();'  value='確 認'>";
		htmlBtn += "	</td>";

		htmlBtn += "</tr>\n";
		htmlBtn += "</table>\n";


		document.getElementById("opBoard").innerHTML = html;
		document.getElementById("opBoardBtn").innerHTML = htmlBtn;

		document.getElementById("opBoard").style.display = "inline";
		document.getElementById("opBoardButtom").style.display = "inline";
		document.getElementById("opBoardBtn").style.display = "inline";
		document.getElementById("opBoardTop").style.display = "inline";

		//パップアップ以外は非活性
		document.getElementById("allbackgr").style.display = "inline";

}


//登録者権限の警告
function inputChk2(){


		//OP情報のHTML作成
		var html = "";
	    var htmlBtn = "";

		html += "<table width='100%'>\n";

		html += "<tr>\n";
		html += "	<td style='font-size:20px; color:blue;'>\n";
		html += "			<br>　登録権限がありません。";
		html += "	</td>\n";
		html += "</tr>\n";

		html += "</table>\n";

		htmlBtn ="";

		htmlBtn += "<table'>\n";
		htmlBtn += "<tr>\n";
		htmlBtn += "	<td  >　　　　　　";
		htmlBtn += "		<input type='button' id='opBtn' class='opBtn' onclick = 'back();'  value='確 認'>";
		htmlBtn += "	</td>";

		htmlBtn += "</tr>\n";
		htmlBtn += "</table>\n";


		document.getElementById("opBoard").innerHTML = html;
		document.getElementById("opBoardBtn").innerHTML = htmlBtn;

		document.getElementById("opBoard").style.display = "inline";
		document.getElementById("opBoardButtom").style.display = "inline";
		document.getElementById("opBoardBtn").style.display = "inline";
		document.getElementById("opBoardTop").style.display = "inline";

		//パップアップ以外は非活性
		document.getElementById("allbackgr").style.display = "inline";

}


//登録完了メッセージ
function registComplete(){

		//OP情報のHTML作成
		var html = "";
	    var htmlBtn = "";

		html += "<table width='100%'>\n";

		html += "<tr>\n";
		html += "	<td style='font-size:20px; color:blue;'>\n";
		html += "			<br>&nbsp;Done. Do you confirm the information on   &nbsp;Production Control Board System screen?</br>";
		html += "	</td>\n";
		html += "</tr>\n";

		html += "</table>\n";

		htmlBtn ="";

		htmlBtn += "<table'>\n";
		htmlBtn += "<tr>\n";
		htmlBtn += "	<td  align = 'left'>　　　　　　";
		htmlBtn += "		<input type='button' id='opBtn' class='btnYes' onclick = 'doSrc2000();'  value='Yes'> <input type='button' id='opBtn' class='btnNo' onclick = 'back();'  value='No'>";
		htmlBtn += "	</td>";

		htmlBtn += "</tr>\n";
		htmlBtn += "</table>\n";


		document.getElementById("opBoard").innerHTML = html;
		document.getElementById("opBoardBtn").innerHTML = htmlBtn;

		document.getElementById("opBoard").style.display = "inline";
		document.getElementById("opBoardButtom").style.display = "inline";
		document.getElementById("opBoardBtn").style.display = "inline";
		document.getElementById("opBoardTop").style.display = "inline";

		//パップアップ以外は非活性
		document.getElementById("allbackgr").style.display = "inline";

}


//作業内容②５個以上の選択時メッセージ
function selectMultiChk(){


	//OP情報のHTML作成
	var html = "";
    var htmlBtn = "";

	html += "<table width='100%'>\n";

	html += "<tr>\n";
	html += "	<td style='font-size:20px; color:blue;'>\n";
	html += "			<br>　作業内容②は５個以上の<br>　選択は出来ません。 ";
	html += "	</td>\n";
	html += "</tr>\n";

	html += "</table>\n";

	htmlBtn ="";

	htmlBtn += "<table'>\n";
	htmlBtn += "<tr>\n";
	htmlBtn += "	<td  >　　　　　　";
	htmlBtn += "		<input type='button' id='opBtn' class='opBtn' onclick = 'back();'  value='確 認'>";
	htmlBtn += "	</td>";

	htmlBtn += "</tr>\n";
	htmlBtn += "</table>\n";


	document.getElementById("opBoard").innerHTML = html;
	document.getElementById("opBoardBtn").innerHTML = htmlBtn;

	document.getElementById("opBoard").style.display = "inline";
	document.getElementById("opBoardButtom").style.display = "inline";
	document.getElementById("opBoardBtn").style.display = "inline";
	document.getElementById("opBoardTop").style.display = "inline";

	//パップアップ以外は非活性
	document.getElementById("allbackgr").style.display = "inline";

}